package com.example.yl.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.yl.entity.Iyqww_YL_ssbxt;
import com.example.yl.entity.Iyqww_YL_ssbxtVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author
 * @createtime 2021-08-14 9:20
 * @description
 */
@Mapper
@Component
public interface YL_ssbMapper {

    ArrayList<Iyqww_YL_ssbxt> findAddress();

    void addForeignId(@Param("foreignId") String str, @Param("address") String address);

    List<Map<String, Object>> staticData(@Param("foreignId") String foreignId);


    @Select("SELECT a.address,a.foreignId,a.sequenceStatus,a.ShortText1608803337156," +
            "a.ShortText1608772055540,a.ShortText1608772160647,a.ShortText1608777161506," +
            "a.ShortText1608796211477,a.ShortText1608799766004,a.ShortText1608801262580," +
            "a.ShortText1608801569614,a.ShortText1608801859045,b.participantName,b.receiveTime," +
            "b.activityName FROM iyqww_YL_ssbxt a LEFT JOIN biz_workitem b ON " +
            "a.workflowInstanceId = b.instanceId where foreignId = #{foreignId} AND sequenceStatus =\"COMPLETED\"")
    List<Iyqww_YL_ssbxtVo> queryAllSsbVo(Page<Iyqww_YL_ssbxtVo> pagination, @Param("foreignId") String foreignId);

    @Select("SELECT a.address,a.foreignId,a.sequenceStatus,a.ShortText1608803337156," +
            "a.ShortText1608772055540,a.ShortText1608772160647,a.ShortText1608777161506," +
            "a.ShortText1608796211477,a.ShortText1608799766004,a.ShortText1608801262580," +
            "a.ShortText1608801569614,a.ShortText1608801859045,b.participantName,b.receiveTime," +
            "b.activityName FROM iyqww_YL_ssbxt a LEFT JOIN biz_workitem b ON " +
            "a.workflowInstanceId = b.instanceId where foreignId = #{foreignId} AND sequenceStatus!=\"COMPLETED\"")
    List<Iyqww_YL_ssbxtVo> queryAllSsbVo1(Page<Iyqww_YL_ssbxtVo> pagination, @Param("foreignId") String foreignId);

}
